{% extends 'base/base.html'%}

{% block title %}
<title>添加笔记</title>
{% endblock title %}
<!-- 面包屑 -->
{% block breadcrumb %}
<li class="breadcrumb-item"><a href="{% url 'index'%}">Home</a></li>
<li class="breadcrumb-item"><a href="#">笔记列表</a></li>
{% endblock breadcrumb %}

{% block content %}
<div class="row">
  <div class="col-sm">
    <div class="list-group">
      {% for contact in page_obj %}
      <a href="{% url 'note_detail' id=contact.id%}" class="list-group-item list-group-item-action ">
        <div class="d-flex w-100 justify-content-between">
          <h5 class="mb-1">{{ contact.title }}</h5>
          <small>更新于：{{ contact.update_time}}</small>
        </div>
        <!-- <p class="mb-1">{{ contact.content  | slice:":20" }}……</p> -->
        <small>状态：{{ contact.status}}</small>
      </a>
      {% endfor %}
    </div>
  </div>
</div>
<div class="row">
  <div class="col-sm"></div>
  <div class="col-sm"></div>
  <div class="col-sm">
    <div class="pagination">
      <span class="step-links">
          {% if page_obj.has_previous %}
              <a href="?page=1">&laquo; 第一页</a>
              <a href="?page={{ page_obj.previous_page_number }}">上一页</a>
          {% endif %}
    
          {% if page_obj.has_next %}
              <a href="?page={{ page_obj.next_page_number }}">下一页</a>
              <a href="?page={{ page_obj.paginator.num_pages }}">最后一页 &raquo;</a>
          {% endif %}
          <span class="current">
               {{ page_obj.number }} / {{ page_obj.paginator.num_pages }}
          </span>
      </span>
    </div>
  </div>
</div>
{% endblock content %}
